<?php
/**
 * @Author: liuhongbin
 * @Email: 514660094@qq.com
 * @Date: 2019-02-12 16:15:10
 * @Description:
 * @LastEditors: liuhongbin
 * @LastEditTime: xxx
 */

namespace app\common\model\platform;

use app\common\model\BaseModel;
use app\common\model\user\User;

/**
 * 小程序用户次数模型
 * @package app\common\model
 * User: liuhongbin
 * Date: 2021-05-25 14:16
 */
class PlatformAppUser extends BaseModel
{
    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'platform_app_user';

    protected $append = array('user');


    public function user()
    {
        return $this->hasOne(User::class, 'uid', 'uid')->field(['username', 'avatar'])->bind(['username', 'avatar']);
    }
}
